﻿using System;
using System.Collections.Generic;
using System.Drawing.Imaging;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Rapattern.Utilities
{
    public class ImageHelper
    {
        /// <summary>
        /// 获取Image图片格式
        /// </summary>
        /// <param name="format"></param>
        /// <returns></returns>
        public static string GetImageFormat(ImageFormat format)
        {
            string result = string.Empty;
            if (format.Equals(ImageFormat.Bmp))
            {
                result = "bmp";
            }
            else if (format.Equals(ImageFormat.Emf))
            {
                result = "emf";
            }
            else if (format.Equals(ImageFormat.Exif))
            {
                result = "exif";
            }
            else if (format.Equals(ImageFormat.Gif))
            {
                result = "gif";
            }
            else if (format.Equals(ImageFormat.Icon))
            {
                result = "icon";
            }
            else if (format.Equals(ImageFormat.Jpeg))
            {
                result = "jpeg";
            }
            else if (format.Equals(ImageFormat.MemoryBmp))
            {
                result = ".";
            }
            else if (format.Equals(ImageFormat.Png))
            {
                result = "png";
            }
            else if (format.Equals(ImageFormat.Tiff))
            {
                result = "tiff";
            }
            else if (format.Equals(ImageFormat.Wmf))
            {
                result = "wmf";
            }
            return result;
        }
    }
}
